﻿using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml.Schema;

namespace ScormModel
{
    [Serializable()]
    public class RollupConsiderations
    {
        private string _requiredForSatisfied ;
        private string _requiredForNotSatisfied ;
        private string _requiredForCompleted ;
        private string _requiredForIncomplete;
        private string _measureSatisfactionIfActive;
         [NonSerialized]
        private XmlNode _rollupConsiderationsContent;
        [XmlAttribute("requiredForSatisfied")]
        public string RequiredForSatisfied
        {
            get { return this._requiredForSatisfied; }
            set { this._requiredForSatisfied = value; }
        }
        [XmlAttribute("requiredForNotSatisfied")]
        public string RequiredForNotSatisfied
        {
            get { return this._requiredForNotSatisfied; }
            set { this._requiredForNotSatisfied = value; }
        }
        [XmlAttribute("requiredForCompleted")]
        public string RequiredForCompleted
        {
            get { return this._requiredForCompleted; }
            set { this._requiredForCompleted = value; }
        }
        [XmlAttribute("requiredForIncomplete")]
        public string RequiredForIncomplete
        {
            get { return this._requiredForIncomplete; }
            set { this._requiredForIncomplete = value; }
        }
        [XmlAttribute("measureSatisfactionIfActive")]
        public string MeasureSatisfactionIfActive
        {
            get { return this._measureSatisfactionIfActive; }
            set { this._measureSatisfactionIfActive = value; }
        }
        
        [XmlIgnoreAttribute]
        public XmlNode RollupConsiderationsContent
        {
            get { return this._rollupConsiderationsContent; }
            set { this._rollupConsiderationsContent = value; }
        }
        public void buildRollupConsiderations()
        {
            XmlAttributeCollection attList = _rollupConsiderationsContent.Attributes;
            if (attList.GetNamedItem("requiredForSatisfied") != null)
            {
                _requiredForSatisfied = ((XmlAttribute)attList.GetNamedItem("requiredForSatisfied")).Value;
            }
            if (attList.GetNamedItem("requiredForNotSatisfied") != null)
            {
                _requiredForNotSatisfied = ((XmlAttribute)attList.GetNamedItem("requiredForNotSatisfied")).Value;
            }
            if (attList.GetNamedItem("requiredForCompleted") != null)
            {
                _requiredForCompleted = ((XmlAttribute)attList.GetNamedItem("requiredForCompleted")).Value;
            }
            if (attList.GetNamedItem("requiredForInComplete") != null)
            {
                _requiredForIncomplete = ((XmlAttribute)attList.GetNamedItem("requiredForInComplete")).Value;
            }
            if (attList.GetNamedItem("measureSatisfactionIfActive") != null)
            {
                _measureSatisfactionIfActive = ((XmlAttribute)attList.GetNamedItem("measureSatisfactionIfActive")).Value;
            }
        }
    }
}
